<!--编辑/添加属性-->
<div class="dialog_content">
	<form id="info_form" action="{:U('attribute/oppt')}" method="post">
    <input type="hidden" name="opttype" value="{$type}" />
	<table width="100%" class="table_form">
        <php>
            if($type=='edit'){
                $info['rules'] = json_decode($info['rules'],1);
            }
        </php>
		<tr>
			<th>{:L('attribute_name')} :</th>
			<td><input type="text" name="name" id="name" class="input-text" value="{$info.name}" size="30"></td>
		</tr>
	    <tr>
        <empty name="pid">
		<tr>
			<th>模块名称 :</th>
			<td><input type="text" name="modular" id="modular" class="input-text" value="{$info.modular}" size="30"></td>
		</tr>
        </empty>
	    <tr>        
			<th>是否显示 :</th>
			<td>
				<label><input type="radio" name="status" value="1" <if condition="$info.status eq 1">checked</if> > {:L('yes')}</label>&nbsp;&nbsp;
				<label><input type="radio" name="status" value="0" <if condition="$info.status eq 0">checked</if> > {:L('no')}</label>
			</td>
		</tr>          
        <notempty name="pid">
    		<tr>
    			<th width="120">{:L('article_cate_parent')} :</th>
    			<td>
                     <select name="pid">
                        <option value="">{:L('please_select')}</option>
                        <volist name="classList" id="item">
                            <option <if condition="$key eq $pid">selected=""</if> value="{$key}">{$item}</option>
                        </volist>
                     </select>
    			</td>
    		</tr>           
    			
    	    <tr>
    			<th>描述 :</th>
    			<td>
			         <textarea rows="1" name="description">{$info.description}</textarea>
    			</td>
    		</tr>   
    	    <tr>
    			<th>类型 :</th>
    			<td>
    				<label><input type="radio" name="type" value="select" <if condition="$info.type eq 'select'">checked</if> > select</label>&nbsp;&nbsp;
    				<label><input type="radio" name="type" value="text" <if condition="$info.type eq 'text'">checked</if> >text</label>
    				<label><input type="radio" name="type" value="radio" <if condition="$info.type eq 'radio'">checked</if> > radio</label>&nbsp;&nbsp;
    				<label><input type="radio" name="type" value="checkbox" <if condition="$info.type eq 'checkbox'">checked</if> >checkbox</label>&nbsp;&nbsp;   
                    <label><input type="radio" name="type" value="number" <if condition="$info.type eq 'number'">checked</if> >number</label>                    
    			</td>
    		</tr> 
            
    	    <tr>
    			<th>规则 :</th>
    			<td>
    			     <textarea name="rules[choices]" style="float: left;">{$info['rules']['choices']}</textarea>       
                     <div class="onShow" style="background: none;float: left;">可选时有效，每行一个字段,例如:<br />
1 = 光电鼠标<br />
2 = 机械鼠标<br />
1.1 = 黑色光电鼠标<br />
2.1 = 白色机械鼠标</div>           
    			</td>
    		</tr>             
    	    <tr>
    			<th>最大长度 :</th>
    			<td>
			         <input type="text" name="rules[maxLength]" value="{$info[rules][maxLength]}"></input>
    			</td>
    		</tr>             
    	    <tr>
    			<th>最小长度 :</th>
    			<td>
			         <input type="text" name="rules[minLength]" value="{$info[rules][minLength]}"></input>
    			</td>
    		</tr> 
    	    <tr>
    			<th>是否必选 :</th>
    			<td>
	               <label><input type="radio" name="rules[isMust]" value="select" <if condition="$info['rules']['isMust'] eq '0'">checked</if> > {:L('no')}</label>&nbsp;&nbsp;
    				<label><input type="radio" name="rules[isMust]" value="text" <if condition="$info['rules']['isMust'] eq '1'">checked</if> >{:L('yes')}</label>
    			</td>
    		</tr>   
                
    	    <tr>
    			<th>默认值 :</th>
    			<td>
			         <input type="text" name="rules[defaultvalue]" value="{$info.rules.defaultvalue}"></input>
    			</td>
    		</tr>                                          
    	    <tr>
    			<th>排序 :</th>
    			<td>
			         <input type="text" name="ordid" value="{$info.ordid}"></input>
    			</td>
    		</tr>                      
            
	   </notempty>
	</table>
	<input type="hidden" name="id" value="{$info.id}" />
	</form>
</div>
<script src="__STATIC__/js/fileuploader.js"></script>
<script>
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.status == 1){
			$.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
		} else {
			$.pinphp.tip({content:result.msg, icon:'alert'});
		}
	}


});
</script>